package com.ruoyi.system.service.impl;


import com.ruoyi.system.domain.Tenant;
import com.ruoyi.system.mapper.TenantMapper;
import com.ruoyi.system.service.ITenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class TenantServiceImpl implements ITenantService {
    @Autowired
    TenantMapper userMapper;
    //查询租客
    @Override
    public List<Tenant> selectTenant(Tenant tenant) {
        List<Tenant> strings = userMapper.selectTenant(tenant);
        return strings;
    }

    //添加租客
    @Override
    public String insertTenant(Tenant tenant) {
        int i = userMapper.insertTenant(tenant);
        if (i==1){
            return "添加成功";
        }
        return "添加失败";
    }

    @Override
    public String deleteTenant(Tenant tenant) {
        int i = userMapper.delectTenant(tenant);
        if (i==1){
            return "删除成功";
        }
        return "删除失败";
    }

    public String updateTenant(Tenant tenant) {

        int i = userMapper.updateTenant(tenant);
        if (i==1){
            return "修改成功";
        }
        return "修改失败";
    }
}
